﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XLINQ(LINQ to XML)之针对XML文件的添加、查询、更新和删除.aspx.cs" Inherits="_35newpart_Linq_XLINQ_LINQ_to_XML_之针对XML文件的添加_查询_更新和删除" EnableEventValidation="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>XLINQ(LINQ to XML)之针对XML文件的添加、查询、更新和删除  Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p>
        姓名：<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        &nbsp;&nbsp; 年龄：<asp:TextBox ID="txtAge" runat="server"></asp:TextBox>
        &nbsp;&nbsp; 薪水：<asp:TextBox ID="txtSalary" runat="server"></asp:TextBox>
        <asp:Button ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" />
    </p>
        <p>
               <asp:GridView ID="gvPerson" runat="server" DataKeyNames="pV" OnSelectedIndexChanged="gvPerson_SelectedIndexChanged"
        OnRowDeleting="gvPerson_RowDeleting" OnRowCancelingEdit="gvPerson_RowCancelingEdit"
        OnRowEditing="gvPerson_RowEditing" OnRowUpdating="gvPerson_RowUpdating">
        <Columns>
            <asp:CommandField ShowSelectButton="True" ShowEditButton="True" ShowDeleteButton="True">
            </asp:CommandField>
        </Columns>
    </asp:GridView>
    <br />
    <asp:DetailsView ID="dvPerson" runat="server" DataKeyNames="pV" DefaultMode="Edit" 
                   onitemupdating="dvPerson_ItemUpdating"  onmodechanging="dvPerson_ModeChanging">
        <Fields>
            <asp:commandfield EditText="编辑" ShowEditButton="True" UpdateText="更新">
            </asp:commandfield>
        </Fields>
    </asp:DetailsView>
</p>
    </div>
    </form>
</body>
</html>
